@extends('admin.layout.main')

@section('content')
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="#">首页</a>
	</li>
	<li><a href="#">系统钱包管理</a></li>
	<li class="active"><a href="{{ url('admin/wallet_list') }}">系统钱包列表 </a></li>
</ul><!-- /.breadcrumb -->

</div>
<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="search-area well col-xs-12">
					<form action="">
						<div class="pull-left">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-only ace-icon fa fa-th"></i>
							<b class="text-primary">状态: </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<select class="" name="status" style="width:100px;">
                                    <option value="99" @if($status==99) selected="selected" @endif>全部</option>
                                    <option value="0" @if($status==0) selected="selected" @endif>可用</option>
                                    <option value="1" @if($status==1) selected="selected" @endif>冻结</option>
                                </select>
							</div>

                            <i class="icon-only ace-icon fa fa-th"></i>
							<b class="text-primary">币种: </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<select class="" name="cid" style="width:100px;">
									<option value="99">全部</option>
                                    @foreach($currs as $curr)
									    <option value="{{$curr->id}}" @if($cid==$curr->id) selected="selected" @endif>{{$curr->name_en}}</option>
                                    @endforeach
								</select>
							</div>

                            <i class="icon-only ace-icon fa fa-th"></i>
							<b class="text-primary">地址: </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<input type="text" name="address" style="width:300px;">
							</div>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<button type="submit" class="btn btn-white btn-info btn-bold">查询</button>
						</div>
					</form>
				</div>
			</div>


			<!-- PAGE CONTENT BEGINS -->
			<div class="row">
				<div class="col-xs-12">
					<!-- div.table-responsive -->
					<!-- div.dataTables_borderWrap -->
					<div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>序号</th>
									<th>币种</th>
									<th>地址</th>
									<th>当前余额</th>
                                    <th>冻结余额</th>
                                    <!--<th>累计充币额</th>
                                    <th>累计提币额</th>
                                    <th>累计手续费</th>-->
									<th>状态</th>
									<th>创建时间</th>
									<th>操作</th>
								</tr>
							</thead>

							<tbody>
								@foreach($data as $key=>$value)
                                    <tr>
                                        <td>{{$key+$page_num}}</td>
                                        <td>
                                        	@if(collect($value->currency)->count() > 0)
                                        	{{$value->currency->name_en}}
                                        	@else
												该币种不存在
                                        	@endif
                                        </td>
                                        <td>{{$value->address}}</td>
                                        <td>{{$value->balance}}</td>
                                        <td>{{$value->block_balance}}</td>

                                        <td>{{\App\Models\Wallet::$STATUS[$value->status]}}</td>
                                        <td>{{ $value->created_at }}</td>
										<td>
											@if(collect($value->currency)->count() > 0)
                                            <a href="/admin/get_address_balance?wallet_id={{$value->id}}">
                                                <button class="btn btn-xs btn-info">查询地址余额</button>
                                            </a>
                                            @endif
                                        </td>
                                    </tr>
								@endforeach
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<!-- PAGE CONTENT ENDS -->
		</div><!-- /.col -->

	</div><!-- /.row -->
	<div class="no-margin-top">
		<ul class="pagination pull-right no-margin">
            {{$data->appends(['status'=>$status, 'cid' => $cid, 'address' => $address])->links()}}
		</ul>
	</div>
</div><!-- /.page-content -->

@endsection
